import request from '~/utils/resquest'

//  资产数据-列表
export const getBasestationList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/basestation/list', method: 'GET', params })
}

//  资产数据-删除
export const getBasestationRemove = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/basestation/remove', method: 'POST', params })
}

//  资产数据-导出
export const basestationExport = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/basestation/export',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

// 资产数据-导入
export const importBasestationPostExcel = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/basestation/import-excel-new',
    method: 'POST',
    data: params
  })

//  资产数据-新增
export const basestationAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/basestation/add', method: 'POST', data })
}

//  资产数据-编辑
export const basestationUpdate = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/basestation/update', method: 'POST', data })
}

//  资产数据-详情
export const basestationView = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basestation/view',
    method: 'GET',
    params
  })
}

//  基站规划-列表
export const getBasebuildList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/basebuild/list', method: 'GET', params })
}

//  基站规划-删除
export const getBasebuildRemove = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/basebuild/remove', method: 'POST', params })
}

//  资产数据-导出
export const basebuildExport = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuild/export',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

// 资产数据-导入
export const importBasebuildPostExcel = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuild/import-excel-new',
    method: 'POST',
    data: params
  })

// 资产数据-导入-更新
export const importBasebuildPostExcelUpdate = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuild/import-excel-update',
    method: 'POST',
    data: params
  })

//  资产数据-新增
export const basebuildAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/basebuild/add', method: 'POST', data })
}

//  资产数据-编辑
export const basebuildUpdate = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/basebuild/update', method: 'POST', data })
}

//  资产数据-详情
export const basebuildView = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuild/view',
    method: 'GET',
    params
  })
}

//  根据关键字搜索地区
export const basestationGetAreaName = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basestation/getAreaName',
    method: 'GET',
    params
  })
}

//  设置灯杆显示范围
export const setLampPostScope = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-assets/stationGisApi/setLampPostScope',
    method: 'GET',
    params
  })
}

//  获取灯杆显示范围
export const getLampPostScope = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-assets/stationGisApi/getLampPostScope',
    method: 'GET',
    params
  })
}

//  周边灯杆
export const getLampPostByscope = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-assets/stationGisApi/getLampPostByscope',
    method: 'GET',
    params
  })
}

//  周边灯杆详情
export const getLampPostById = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-assets/stationGisApi/getLampPostById',
    method: 'GET',
    params
  })
}

//  需求批次统计结果
export const getBatchTotalResult = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/batchTotalResult',
    method: 'GET',
    params
  })
}

//  建设中批次统计分页查询
export const getBasebuildbatchTotalList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/batchTotalList',
    method: 'GET',
    params
  })
}

//  特批详情
export const getBasebuildbatchTotalInfo = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/batchTotalInfo',
    method: 'GET',
    params
  })
}

// 导入摘牌结果
export const importBasebuildPostExcelResult = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuildbatch/basebuild-import-excel-result',
    method: 'POST',
    data: params
  })

//  导出需求批次筛选数据
export const exportBatchExport = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuildbatch/exportBatch',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

//  摘牌库管理-批次分析
export const getBasebuildbatchTotal = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/total',
    method: 'GET',
    params
  })
}

//  摘牌库管理-需求批次列表搜索
export const getBasebuildbatchBatchList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/batchList',
    method: 'GET',
    params
  })
}

//  摘牌库管理-加入摘牌库
export const getBasebuildbatchAddDelisting = <T>(params: T) => {
  return request(
    {
      url: '/api/gxsaas-basestation/basebuildbatch/addDelisting',
      method: 'POST',
      params
    },
    false
  )
}

//  站址查勘-加入摘牌库
export const getBasebuildbatchAddBuildDelisting = <T>(params: T) => {
  return request(
    {
      url: '/api/gxsaas-basestation/basebuildbatch/addBuildDelisting',
      method: 'POST',
      params
    },
    false
  )
}

//  摘牌库管理-需求匹配列表搜索
export const getBasebuildbatchBatchMatchList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/matchList',
    method: 'GET',
    params
  })
}

//  摘牌库管理-摘牌结果列表
export const getBasebuildbatchDistingList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/distingList',
    method: 'GET',
    params
  })
}

//  摘牌库管理-更新摘牌时间
export const getBasebuildbatchSetDelistingTime = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/setDelistingTime',
    method: 'POST',
    params
  })
}

//  摘牌库管理-移出摘牌库
export const getBasebuildbatchRemoveDelisting = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/removeDelisting',
    method: 'POST',
    params
  })
}

//  摘牌库管理-更新批次折扣数据
export const getBasebuildbatchUpdateDelisting = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/updateDelisting',
    method: 'POST',
    params
  })
}

//  摘牌库管理-导出
export const basebuildbatchExport = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuildbatch/exportDelisting',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

// 导入摘牌结果
export const importBasebuildbatch = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/basebuildbatch/import-excel-result',
    method: 'POST',
    data: params
  })

//  机柜管理-列表
export const getCabinetList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/cabinet/list',
    method: 'GET',
    params
  })
}

//  机柜管理-删除
export const getCabinetRemove = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/cabinet/remove', method: 'POST', params })
}

// 机柜管理-导入
export const importCabinet = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/cabinet/import-excel-new',
    method: 'POST',
    data: params
  })

//  机柜管理-导出
export const exportCabinet = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/cabinet/export',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

//  机柜管理-新增
export const getCabinetAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/cabinet/add', method: 'POST', data })
}

//  机柜管理-编辑
export const getCabinetUpdate = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/cabinet/update', method: 'POST', data })
}

//  机柜管理-详情
export const getCabinetView = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/cabinet/view',
    method: 'GET',
    params
  })
}

//  电表管理-列表
export const getElectricityList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/electricity/list',
    method: 'GET',
    params
  })
}

//  电表管理-删除
export const getElectricityRemove = <T>(params: T) => {
  return request({ url: '/api/gxsaas-basestation/electricity/remove', method: 'POST', params })
}

// 电表管理-导入
export const importeEectricity = <T>(params: T) =>
  request({
    url: '/api/gxsaas-basestation/electricity/import-excel-new',
    method: 'POST',
    data: params
  })

//  电表管理-导出
export const exportElectricity = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-basestation/electricity/export',
    method: 'GET',
    responseType: 'blob',
    ...payload
  })

//  电表管理-新增
export const getElectricityAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/electricity/add', method: 'POST', data })
}

//  电表管理-编辑
export const getElectricityUpdate = <T>(data: T) => {
  return request({ url: '/api/gxsaas-basestation/electricity/update', method: 'POST', data })
}

//  电表管理-详情
export const getElectricityView = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/electricity/view',
    method: 'GET',
    params
  })
}

//  电表管理-根据code查询关联匹配
export const getElectricitySelectListCode = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/electricity/selectListCode',
    method: 'GET',
    params
  })
}

//  站址查勘-查勘时光机历史接口
export const getBaseBuildHistroy = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuildbatch/getBaseBuildHistroy',
    method: 'GET',
    params
  })
}

//  站址查勘-批次关键字查询下拉框
export const getSelectBatchNumListBox = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-basestation/basebuild/selectBatchNumListBox',
    method: 'GET',
    params
  })
}

//  站址查勘-操作记录
export const getListBusinessLogByUser = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-log/operationLog/listBusinessLogByUser',
    method: 'GET',
    params
  })
}

//  资产分布-工区数据
export const getWorkAreaList = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-assets/stationGisApi/getWorkAreaList',
    method: 'GET',
    params
  })
}
